<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>">
<title>项目管理系统 </title>
<link rel="stylesheet" rev="stylesheet" href="jsp/skin/css/style.css" type="text/css" media="all" />


<script language="JavaScript" type="text/javascript">

function userRegister(){
   if(checkAll()==0 || passwordCon()==0){
      alert("注册信息有漏下或者不正确!");
   }else{
      document.register.action="servlet/UserRegisterServlet";
      document.register.method="post";
      document.register.submit();
      
   }
   }
   
 function pageInit(){
      <%
        Object obj = request.getAttribute("message");
      %>
      var message = '<%=obj%>';
     if(message!='null'){
       alert(message);
     }
   }
   
   function checkAll(){
       return isNull("userName")*isNull("passWord");
   }
   
   function passwordCon(){
      if(isNull("passWord")*isNull("passWordCon")==0)
      {
         alert("密码或确认密码至少有一项为空！");
         return 0;
      }else{
         if(document.getElementById("passWord").value!=document.getElementById("passWordCon").value){
             alert("密码和确认密码必须相同！");
             return 0;
          }else{
             return 1;
          }
      }
   }
   
   
//为空检验
function isNull(id){
   var idValue = document.getElementById(id).value;
     if(idValue==""){
     alert(id+"项不能为空！");
     return 0;
  }else{
    return 1;
  }
}
</script>
<style type="text/css">
<!--
.atten {font-size:12px;font-weight:normal;color:#F00;}
-->
</style>
</head>

<body class="ContentBody" onload="pageInit();">
  <form action="" method="post" name="register" id="register">
<div class="MainDiv">
<table width="99%" border="0" cellpadding="0" cellspacing="0" class="CContent">
  <tr>
      <th class="tablestyle_title" >用户注册页面</th>
  </tr>
  <tr>
    <td class="CPanel">
		
		<table border="0" cellpadding="0" cellspacing="0" style="width:100%">
		<tr>
			<td width="100%">
				<fieldset style="height:100%;">
				<legend>用户注册</legend>
				   <table border="0" cellpadding="2" cellspacing="1" style="width:100%">
				   <tr align="center"><td><h3>注册信息</h3></td><td><hr noshade color="#0066cc"></hr></td>
					    </tr>
				      <tr>
					    <td align="right" width="13%">email:</td>
					    <td width="41%"><input name="email" id="email" class="text" style="width:250px" type="text" size="40" />
				        <span class="red"> *</span></td>
					    </tr>
					    <tr>
					    <td align="right" width="13%">密码:</td>
					    <td width="41%"><input name="passWord" id="passWord" class="text" style="width:250px" type="password" size="40" />
				        <span class="red"> *</span></td>
					    </tr>
					    <tr>
					    <td align="right" width="13%">确认密码:</td>
					    <td width="41%"><input name="passWordCon" id="passWordCon" class="text" style="width:250px" type="password" size="40" />
				        <span class="red"> *</span></td>
					    </tr>
					    <tr align="center"><td><h3>个人信息</h3></td><td><hr noshade color="#0066cc"></hr></td>
					    </tr>
					    <tr>
					    <td align="right" width="13%">姓名:</td>
					    <td width="41%"><input name="userName" id="userName" class="text" style="width:250px" type="text" size="40" />
				        <span class="red"> *</span></td>
					    </tr>
					    <tr>
					    <td align="right" width="13%">年龄:</td>
					    <td width="41%"><input name="age" id="age" class="text" style="width:250px" type="text" size="40" />
				        <span class="red"> *</span></td>
					    </tr>
					    <tr>
					    <td align="right" width="13%">性别:</td>
					    <td width="41%"><input type="radio" name="sex" value="1" checked="checked"/>男&nbsp;&nbsp;<input type="radio" name="sex" value="0"/>女</td>
					    </tr>
					    <tr>
					    <td align="right" width="13%">体重:</td>
					    <td width="41%"><select name="weight" id="weight">
                            <option selected="selected" value="01">10公斤以下</option>
						    <option value="02">10-20公斤</option>
						    <option value="03">20-30公斤</option>
						    <option value="04">30-40公斤</option>
						    <option value="05">40-50公斤</option>
						    <option value="06">50-60公斤</option>
						    <option value="07">60-70公斤</option>
						    <option value="08">70-80公斤</option>
						    <option value="09">80公斤以上</option>
                          </select></td>
					    </tr>
					    <tr>
					    <td align="right" width="13%">身高:</td>
					    <td width="41%"><select name="height" id="height">
						    <option selected="selected" value="01">120cm以下</option>
						    <option value="02">120cm-130cm</option>
						    <option value="03">130cm-140cm</option>
						    <option value="04">140cm-150cm</option>
						    <option value="05">150cm-160cm</option>
						    <option value="06">160cm-170cm</option>
						    <option value="07">170cm-180cm</option>
						    <option value="08">180cm-190cm</option>
							<option value="09">190cm以上</option>
                          </select></td>
					    </tr>
					    <tr align="center"><td><h3>其他信息</h3></td><td><hr noshade color="#0066cc"></hr></td>
					    </tr>
					    <tr>
					    <td align="right" width="13%">血型:</td>
					    <td width="41%"><select name="bloodType" id="bloodType">
                            <option selected="selected" value="1">A</option>
						    <option value="2">B</option>
						    <option value="3">AB</option>
						    <option value="4">O</option>
                          </select></td>
					    </tr>
					    <tr>
					    <td align="right" width="13%">信仰:</td>
					    <td width="41%"><select name="belief" id="belief">
                            <option selected="selected" value="1">佛教</option>
						    <option value="2">伊斯兰教</option>
						    <option value="3">基督教</option>
						    <option value="4">其他</option>
                          </select></td>
					    </tr>
					    <tr>
					    <td align="right" width="13%">学历:</td>
					    <td width="41%"><select name="degree" id="degree">
						    <option selected="selected" value="01">小学</option>
						    <option value="02">初中</option>
						    <option value="03">高中</option>
						    <option value="04">大专</option>
						    <option value="05">本科</option>
						    <option value="06">硕士</option>
						    <option value="07">博士</option>
                          </select></td>
					    </tr>
					     <tr>
					    <td align="right" width="13%">行业:</td>
					    <td width="41%"><select name="industry" id="industry">
						    <option selected="selected" value="01">IT</option>
						    <option value="02">金融</option>
						    <option value="03">法律</option>
						    <option value="04">医生</option>
						    <option value="05">公务员</option>
						    <option value="06">其他</option>
                          </select></td>
					    </tr>
					    <tr>
					    <td align="right" width="13%">收入:</td>
					    <td width="41%"><select name="income" id="income">
                            <option selected="selected" value="01">1000以下</option>
						    <option value="伊斯兰教">1000-4000</option>
						    <option value="03">4000-10000</option>
						    <option value="04">10000以上</option>
                          </select></td>
					    </tr>
					     <tr>
					    <td align="right" width="13%">省份:</td>
					    <td width="41%"><select name="province" id="province">
						    <option selected="selected" value="01">北京</option>
						    <option value="02">上海</option>
						    <option value="03">天津</option>
						    <option value="04">重庆</option>
						    <option value="05">浙江省</option>
						    <option value="06">河南省</option>
						    <option value="07">湖南省</option>
						    <option value="08">湖北省</option>
							<option value="09">福建省</option>
                          </select></td>
					    </tr>
					    <tr>
					     <td align="right" width="13%">婚姻:</td>
					     <td width="41%"><input type="radio" name="marriage" value="1" checked="checked"/>未婚&nbsp;&nbsp;<input type="radio" name="marriage" value="2"/>已婚</td>
					    </tr>
					    <tr align="center"><td><h3>备注信息</h3></td><td><hr noshade color="#0066cc"></hr></td>
					    </tr>
					    <tr>
					     <td align="right" width="13%">备注一:</td>
					     <td width="41%"><textarea name="bak1" id="bak1" cols="40" rows="5"></textarea></td>
					    </tr>
					    <tr>
					     <td align="right" width="13%">备注二:</td>
					     <td width="41%"><textarea name="bak2" id="bak2" cols="40" rows="5"></textarea></td>
					    </tr>
					    
					  </table>
			 <br />
				</fieldset>		</td>	</tr>
		
		
		</table>
	
	
	 </td>
  </tr>
  

		
		
		
		
		<tr>
			<td colspan="2" align="center" height="50px" >
			<input type="button" name="Button" value="注册" class="button" onclick="userRegister();"/>　
			</td>
		</tr>
		</table>
	

  
  
  
  


</div>
</form>
</body>
</html>

